//
//  LBCCategorySection.m
//  喜马拉雅改良版框架
//
//  Created by dllo on 15/12/30.
//  Copyright © 2015年 蓝鸥科技. All rights reserved.
//

#import "LBCCategorySection.h"

@interface LBCCategorySection ()

@property (nonatomic, strong)UIImageView *playImageView;

@end

@implementation LBCCategorySection


-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.backgroundColor = [UIColor whiteColor];
        self.playImageView = [UIImageView new];
        _playImageView.image = [UIImage imageNamed:@"findsection_logo@2x.png"];
        [self addSubview:_playImageView];
        [_playImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(@10);
            make.bottom.mas_equalTo(@-8);
            make.top.mas_equalTo(@23);
            make.width.equalTo(_playImageView.mas_height);
            
        }];
        
        self.titleLabel = [UILabel new];
        _titleLabel.text = @"最火";
        _titleLabel.font = [UIFont systemFontOfSize:15];
        [self addSubview:_titleLabel];
        [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.mas_equalTo(@-5);
            make.top.mas_equalTo(@20);
            make.left.equalTo(_playImageView.mas_right).offset(5);
            make.width.mas_equalTo(SCREEN_WIDTH / 2);
            
        }];
        
        self.moreBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [_moreBtn setImage:[UIImage imageNamed:@"liveRadioSectionMore_Normal@2x.png"] forState:UIControlStateNormal];
        [_moreBtn addTarget:self action:@selector(btnAction) forControlEvents:UIControlEventTouchUpInside];
        [self addSubview:_moreBtn];
        [_moreBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(@20);
            make.bottom.mas_equalTo(@-3);
            make.right.mas_equalTo(@-10);
            make.width.mas_equalTo(SCREEN_WIDTH / 9.375);
            
        }];
        
        
    }
    return self;
}

- (void)btnAction{
    [self.categorySectionDelegate presentToAllViewControllerIndex:_index];
}







/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
